<template>
	<a-row  class='main' > 
		<a-spin   :indicator="indicator"  tip="正在加载中..."  :spinning='spinning'  :delay="delayTime">
			<a-row  >
	  			<a-col   class='common-bg'>
	  				<div class='ft20 fontWeight'>{{baseform.name}}</div>
	  				<a-row  class='text-center  mt28'> 	 
		      			<a-col class="gutter-row" :span="5" >
		      				<span  class='color-666'>规模</span><br /><br />
		      				<span  class='color-minor  ft20'>{{baseform.prjSize}}万元</span> 
		      			</a-col> 
		      			<a-col class="gutter-row" :span="5" >
		      				<span  class='color-666'>项目类型</span><br /><br />
		      				<span  class='color-minor  ft20'>{{baseform.type | propertyType}}</span> 
		      			</a-col> 
		      			<a-col class="gutter-row" :span="5" >
		      				<span  class='color-666'>融资主体性质</span><br /><br />
		      				<span  class='color-minor  ft20'>{{baseform.financingSubjectNature | financingSubjectNature}}</span> 
		      			</a-col> 
		      			<a-col class="gutter-row" :span="5" >
		      				<span  class='color-666'>所属集团</span><br /><br />
		      				<span  class='color-minor  ft20'>{{baseform.affiliatedGroup || '--'}}</span> 
		      			</a-col> 
		      			<a-col class="" :span="4" >
		      				<span  class='color-666'>存续周期</span><br /><br />
		      				<span  class='color-minor  ft20'>{{baseform.subsistingCycle}}个月</span> 
		      			</a-col> 
				    </a-row>
	  			</a-col>
	  		</a-row>
	  		<a-row  class='mt20'>
	  			<a-col  class='common-bg'>
	  				<!-- 基本信息 -->
	  				<dl  class='pb20 b-dashed-1 '>
	  					<dt  class='ft20 color-main fontWeight'>基本信息</dt>
	  					<a-row  class='mt12  lh32'>
	  						<a-col :span='12'>
	  							<a-row  >
		  							<a-col  :span='8' :offset='4'  class='color-999'>资产名称</a-col><a-col  :span='12'>{{baseform.name}}</a-col>
		  							<a-col  :span='8' :offset='4'  class='color-999 pt20'>项目规模</a-col><a-col  :span='12'>{{baseform.prjSize}}万元</a-col>
		  							<a-col  :span='8' :offset='4'  class='color-999 pt20'>所属集团</a-col><a-col  :span='12'>{{baseform.affiliatedGroup}}</a-col>
		  							<a-col  :span='8' :offset='4'  class='color-999 pt20'>期望募集周期</a-col><a-col  :span='12'>{{baseform.expectRecruitmentCycle || '--'}}</a-col>
		  							<a-col  :span='8' :offset='4'  class='color-999 pt20'>发行方</a-col><a-col  :span='12'>{{baseform.issuer || '--'}}</a-col>
		  							<a-col  :span='8' :offset='4'  class='color-999 pt20'>期望募集开始日期</a-col><a-col  :span='12'>{{baseform.expectStartDate  | formatDates}}</a-col>
		  						</a-row>
	  						</a-col>
	  						<a-col :span='12'>
	  							<a-row  >
		  							<a-col  :span='8' :offset='4'  class='color-999'>项目类型</a-col><a-col  :span='12'>{{baseform.type | propertyType}}</a-col>
		  							<a-col  :span='8' :offset='4'  class='color-999'>融资主体性质</a-col><a-col  :span='12'>{{baseform.financingSubjectNature | financingSubjectNature}}</a-col>
		  							<a-col  :span='8' :offset='4'  class='color-999'>存续周期</a-col><a-col  :span='12'>{{baseform.subsistingCycle}}个月</a-col>
		  							<a-col  :span='8' :offset='4'  class='color-999'>募集路径</a-col><a-col  :span='12'>{{baseform.collectionAmtType | collectionAmtType}}</a-col>
		  							<a-col  :span='8' :offset='4'  class='color-999'>增信方</a-col><a-col  :span='12'>{{baseform.increasingCredit}}</a-col>
		  						</a-row>
	  						</a-col>
	  					</a-row>
	  				</dl>
	  				
	  				<dl  class='pb20 b-dashed-1 '   v-if='baseform.imageList && baseform.imageList.length>0'>
	  					<dt  class='ft20 color-main fontWeight'>资产发行结构图</dt>
	  					<div  class='mt20' >
		  					 <img  :src='imgsrc'  style="max-width: 100%;">
		  				</div>
	  				</dl>
	  				<!-- 产品资料 -->
	  				<dl  class='pb20 '  v-if='baseform.fileVOList && baseform.fileVOList.length>0'>
	  					<dt  class='ft20 color-main fontWeight'>项目资料</dt>
	  					<div  class='mt20'>
		  					<a-button  class='mr15 '  icon="download" style='font-size: 14px;'  v-for='item in baseform.fileVOList'  @click='downloadFile(item.code)'>{{item.name}}</a-button>  
		  				</div>
	  				</dl>
	  				
	  			</a-col>
	  		</a-row>
	  	</a-spin>
	</a-row>
</template>

<script >
import { download_file }  from '@/api/common'
import { propertyDetail }  from  '@/api/home/index'
export default {
	name:'productDetail',
	data(){
		return {
			spinning:false,
	    	indicator:<a-icon type="loading-3-quarters"  spin  style="{ fontSize: '16px' , color :'#1e49a5' }"/> ,
	    	delayTime:500,
			baseform:{},
			imgsrc:process.env.BASE_API+'/op/fileupload/download_file?token='+sessionStorage.getItem('tokenId')+'&fileCode=',//返回流程图
		}
	},
	created(){
		let code  = this.$route.query.code
		this.pageInit(code)
	},
	methods:{
		pageInit(code){
			this.spinning = true
			propertyDetail(code).then((res)=>{
				if(res.data.flag == true){
					this.baseform = res.data.data
					//返回流程图
					if(this.baseform.imageList && this.baseform.imageList.length>0){
						this.imgsrc+=this.baseform.imageList[0].code
					}
				}
				this.spinning = false
			})
			.catch((err)=>{
				this.spinning = false
			})
		},
		downloadFile(code){
			download_file(code)
		}
	},
	components:{
  		
  	}
}
</script>

<style scoped="scoped">
.main{padding:20px 0  50px;width: 1200px;margin:0 auto;}  
  
/*卡片内容背景板*/
.common-bg{background-color: #fff;padding:20px 30px;}
/*产品信息栅栏条*/ 
.gutter-row{border-right: 1px dashed #999;}
 
</style>